package com.foreknow.demo4;

/**
 * for(表达式1;表达式2;表达式3){
 *         	循环体;
 *         }
 * 计算: sum = 1+2........+10的和是多少?
 */
public class LoopDemo1 {
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1;i <= 10;i++) {
            //累加求和
            sum += i;
        }
        System.out.println(sum);
    }
}
